Package i2p :: Module samclasses :: Class SAMTerminal
[show private | hide private]
[frames | no frames]

Class SAMTerminal


Message-by-message communication with SAM through a single pysocket. _on_* messages are dispatched to msgobj.
Method Summary
  __init__(self, addr, msgobj)
  _poll_loop(self)
Polling loop for incoming messages.
  _samdecode(self, s)
Given a SAM command, returns (a, b), where a is the string at the beginning of the command, and b is a dictionary of name, value pairs for the command.
  check(self)
Raise an error if terminal was closed, otherwise do nothing.
  check_message(self, kwargs)
Raises an error if kwargs['RESULT'] != 'OK'.
  close(self)
Close the SAM terminal.
  on_message(self, msg, kwargs)
Process a SAM message that was received.
  queue_get(self, q)
Identical to q.get() unless a call to self.check() fails, in which case the waiting is cut short with an error.
  send_message(self, msg)
Send a message to the SAM bridge.

Method Details

_poll_loop(self)

Polling loop for incoming messages.

_samdecode(self, s)

Given a SAM command, returns (a, b), where a is the string at the beginning of the command, and b is a dictionary of name, value pairs for the command.

check(self)

Raise an error if terminal was closed, otherwise do nothing.

check_message(self, kwargs)

Raises an error if kwargs['RESULT'] != 'OK'.

close(self)

Close the SAM terminal.

on_message(self, msg, kwargs)

Process a SAM message that was received. Dispatch to self._on_MESSAGE_NAME(**kwargs).

queue_get(self, q)

Identical to q.get() unless a call to self.check() fails, in which case the waiting is cut short with an error.

send_message(self, msg)

Send a message to the SAM bridge. A newline will be automatically added if none is present.

Generated by Epydoc 2.1 on Mon Aug 02 01:07:41 2004 http://epydoc.sf.net